package com.mall.users.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.model.domain.UmsAdmin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UmsAdminMapper extends BaseMapper<UmsAdmin> {

    @Select("select * from ums_admin where username = #{username}")
    UmsAdmin selectByUsername(String username);

    @Select("select * from ums_admin where id = #{id}")
    UmsAdmin selectById(Long id);

    Integer selectCount(String username);


    List<UmsAdmin> selectByPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, @Param("username") String username);


    @Delete("delete  from ums_admin where id  = #{id}")
    void deleteById(Long id);

    void add(UmsAdmin umsAdmin);

    void update( UmsAdmin umsAdmin);
}
